The present invention relates to a system, method, and program for checking database consistency, and more specifically to a system, method, and program for checking consistency of pointers in a hierarchical database.
A hierarchical database such as IBM® IMS™ is provided with a high-speed pointer check function, called a hash check function, for checking database consistency. The hash check function, instead of directly comparing the values of pointers owned by individual segments recorded in the database with the relative byte addresses (RBAs) of target segments pointed to by the pointers, compares the sum of the values of the pointers with the sum of the RBAs of the target segments to check consistency therebetween.
The hash check function determines that consistency is found if both total values are the same, and determines that inconsistency is found if both total values are different. However, even if it is determined that inconsistency is found, it is not determined which pointer or RBA is incorrect only by using a hash check. Therefore, it is necessary to directly compare pointer values with RBAs for correct checking.
Apparently, the number of pointers and the number of target segments should be the same in order to make the hash check effective. That is, pointers and target segments should have one-to-one relationships. However, pointers and target segments may have n-to-one relationships depending on the type of pointer. This corresponds to the case where, for example, a plurality of child segments have parent pointers pointing to the same parent segment. In this case, the number of parent pointers is n (>1) while the number of parent segments, which are target segments, is one. Thus, a conventional hash check function does not make it possible to check the consistency of such parent pointers.
Therefore, it is an object of the present invention to provide a system, method, and program that can check the consistency of pointers using a correct hash check even if the number of pointers and the number of target segments pointed to by these pointers differ in a hierarchical database.